package pers.csw.lookBook.controller.front;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pers.csw.lookBook.common.Res;
import pers.csw.lookBook.entity.Chapter;
import pers.csw.lookBook.service.ChapterService;

@CrossOrigin
@RestController
@RequestMapping("/chapter")
public class ChapterController {
    @Autowired
    ChapterService chapterService;

    /**
     * 通过书籍id返回书籍所有的章节信息
     * @param bookId 书籍id
     * @return 返回该书籍所有章节信息
     */
    @GetMapping("/getChapter/{bookId}")
    public Res getChapterList(@PathVariable Integer bookId){
        return Res.success(chapterService.getChapter(bookId));
    }

}
